home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / mkmf.man < prev    next >
Encoding:
Text File  |  1991-05-31  |  40.1 KB  |  861 lines

  1.  
  2.  
  3.  
  4. MKMF                      User Commands                      MKMF
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      mkmf - generate Makefiles automatically
  12.  
  13. SSYYNNOOPPSSIISS
  14.      mmkkmmff [--ff _m_a_k_e_f_i_l_e] [--xx] [--mm _m_a_c_h_i_n_e_T_y_p_e] [--mm_m_a_c_h_i_n_e_T_y_p_e]
  15.  
  16. OOPPTTIIOONNSS
  17.      --ff _m_a_k_e_f_i_l_e
  18.           Generate a file named  _m_a_k_e_f_i_l_e  instead  of  MMaakkeeffiillee.
  19.           Also  use  _m_a_k_e_f_i_l_e.pprroottoo, _m_a_k_e_f_i_l_e.eedd, and _m_a_k_e_f_i_l_e.eexx
  20.           instead of MMaakkeeffiillee..pprroottoo etc.
  21.  
  22.      --xx   Turns on echo-ing so that all the commands in the  mmkkmmff
  23.           scripts  are  printed  on the terminal.  This is useful
  24.           primarily for debugging mmkkmmff scripts.
  25.  
  26.      --mm _m_a_c_h_i_n_e_T_y_p_e or --mm_m_a_c_h_i_n_e_T_y_p_e
  27.           Work only on subdirectory for _m_a_c_h_i_n_e_T_y_p_e. Multiple  --mm
  28.           flags  can  be  used  to  run  mmkkmmff on multiple machine
  29.           types.
  30.  
  31. _________________________________________________________________
  32.  
  33.  
  34. IINNTTRROODDUUCCTTIIOONN
  35.      MMkkmmff generates a MMaakkeeffiillee for the current working directory.
  36.      It  also  creates  additional make-related files in machine-
  37.      dependent subdirectories of the current directory.  MMkkmmff can
  38.      generate  MMaakkeeffiillees  for a variety of directories, including
  39.      those holding programs, libraries, header libraries,  kernel
  40.      sources,  and  other things.  mmkkmmff manages all of the direc-
  41.      tories holding Sprite system code.  In normal use,  all  you
  42.      should  have  to  do  is  type "mkmf";  mmkkmmff will generate a
  43.      suitable MMaakkeeffiillee based on the directory's  full  path  name
  44.      and  the files and subdirectories in it.  After that you can
  45.      invoke ppmmaakkee to recompile in the directory, install, and  so
  46.      on.   The  files produced by mmkkmmff will only work with ppmmaakkee,
  47.      not with the original UNIX version of mmaakkee  (but  in  Sprite
  48.      mmaakkee  is  a  symbolic link to ppmmaakkee).  This man page assumes
  49.      that you are familiar with ppmmaakkee;  if not, you  should  read
  50.      the ppmmaakkee tutorial.
  51.  
  52.      Warning:   there  is  also  a  UNIX  program  called   mmkkmmff;
  53.      although its general goal is the same as this program's, its
  54.      mechanisms are very different.
  55.  
  56.      Normally, you should re-run mmkkmmff in a directory whenever you
  57.      add or delete source files.  When mmkkmmff runs, it assumes that
  58.      all of the source files (those with extensions .c,  .h,  .y,
  59.      etc.)  are to be used to create a single program or library,
  60.      and it generates MMaakkeeffiillee accordingly.  If there are  source
  61.      files  that  don't  pertain to the thing being created (e.g.
  62.  
  63.  
  64.  
  65. Sprite v.1.0         Printed:  May 31, 1991                     1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. MKMF                      User Commands                      MKMF
  73.  
  74.  
  75.  
  76.      test programs), put them in a subdirectory where mmkkmmff  won't
  77.      see them.
  78.  
  79.  
  80. MMAAKKEEFFIILLEE SSTTRRUUCCTTUURREE
  81.      The makefile structure that mmkkmmff generates is a bit  compli-
  82.      cated,  but  it's  also  powerful and flexible.  Among other
  83.      things, it supports compilation for multiple target machines
  84.      from  a  single set of source files, and it makes it easy to
  85.      make a global change in the way all directories of a partic-
  86.      ular  type  are  made  (e.g.  all  command  programs, or all
  87.      libraries).  For most directories there are  five  kinds  of
  88.      ppmmaakkee-related files:
  89.  
  90.      MMaakkeeffiillee
  91.           This is the main file generated  by  mmkkmmff,  but  it  is
  92.           short  and  does relatively little.  It sets up several
  93.           ppmmaakkee variables that give the name of  the  program,  a
  94.           list  of  target  machines for which the program can be
  95.           compiled, default flags for C compilation, and  so  on.
  96.           Then MMaakkeeffiillee includes the other files described below,
  97.           which contain most of the useful ppmmaakkee-related informa-
  98.           tion.   MMaakkeeffiillee  contains information that may be dif-
  99.           ferent for this directory than for other directories of
  100.           the  same  type  (for  example, each library has a dif-
  101.           ferent name), but it only contains information that  is
  102.           independent of the particular target machine being com-
  103.           piled for.
  104.  
  105.      **..mmdd//mmdd..mmkk
  106.           There is one subdirectory for each target machine  that
  107.           this  program  or  library or module can be compiled to
  108.           run on.  These are called  _m_a_c_h_i_n_e-_d_e_p_e_n_d_e_n_t  _s_u_b_d_i_r_e_c_-
  109.           _t_o_r_i_e_s  and  have names _x..mmdd wwhheerree _x is the type of the
  110.           target machine, e.g., ssuunn22..mmdd or ssuunn33..mmdd.   A  machine-
  111.           dependent  subdirectory  holds  all information that is
  112.           different for that particular machine  than  for  other
  113.           machines.   This includes the object files compiled for
  114.           that machine, plus any machine-dependent sources.  Most
  115.           user programs don't have machine-dependent sources, but
  116.           many of the kernel modules and libraries do.   In  each
  117.           machine-dependent  subdirectory  there is a file mmdd..mmkk,
  118.           generated automatically by mmkkmmff.  MMdd..mmkk is included  by
  119.           MMaakkeeffiillee  and  creates  variables  like SSRRCCSS,, OOBBJJSS, and
  120.           HHDDRRSS.  These describe the files needed to recompile for
  121.           that   target  machine,  including  both  the  machine-
  122.           independent files in the parent directory (the one con-
  123.           taining  MMaakkeeffiillee)  and  the machine-dependent files in
  124.           the _x..mmdd subdirectory.
  125.  
  126.      **..mmdd//ddeeppeennddeenncciieess..mmkk
  127.           There is one of these files in  each  machine-dependent
  128.  
  129.  
  130.  
  131. Sprite v.1.0         Printed:  May 31, 1991                     2
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. MKMF                      User Commands                      MKMF
  139.  
  140.  
  141.  
  142.           subdirectory.   DDeeppeennddeenncciieess..mmkk  lists the header files
  143.           used directly or indirectly by each source file.  It is
  144.           included   by  MMaakkeeffiillee  so  that  ppmmaakkee  will  do  the
  145.           appropriate   recompilations   when   headers   change.
  146.           DDeeppeennddeenncciieess..mmkk  files  are  generated automatically by
  147.           mmaakkeeddeeppeenndd.  The command ``pmake depend'' will run mmaakk--
  148.           eeddeeppeenndd   to  regenerate  ddeeppeennddeenncciieess..mmkk.   MMkkmmff  also
  149.           issues a ``pmake depend'' command whenever it runs.
  150.  
  151.      _s_y_s_m_a_k_e_f_i_l_e
  152.           There only a few different kinds of source  directories
  153.           in  Sprite:  commands,  libraries,  kernel modules, etc
  154.           (see ``HOW MKMF WORKS''  below).   For  each  of  these
  155.           types  of  directories, there is one file of ppmmaakkee com-
  156.           mands that contains all of the ``real stuff'' that con-
  157.           trols  recompilation,  installing,  etc.  MMaakkeeffiillee sets
  158.           the variable SSYYSSMMAAKKEEFFIILLEE to hold the name of this file,
  159.           and  under  normal conditions MMaakkeeffiillee will include the
  160.           sysmakefile whenever ppmmaakkee is invoked (see ``PERSONALI-
  161.           ZATION''  below  for  exceptions  to  this  rule).  The
  162.           sysmakefiles use the variables and dependencies set  up
  163.           by   MMaakkeeffiillee,   mmdd..mmkk,   and   ddeeppeennddeenncciieess..mmkk.    The
  164.           sysmakefiles are all stored in //sspprriittee//lliibb//ppmmaakkee.
  165.  
  166.      _u_t_i_l_i_t_y _m_a_k_e_f_i_l_e_s
  167.           There is a collection of small makefiles in the  direc-
  168.           tory    //sspprriittee//lliibb//ppmmaakkee,   which   are   include   by
  169.           sysmakefiles for operations that  are  shared  by  many
  170.           sysmakefiles.
  171.  
  172.  
  173. SSTTAANNDDAARRDD TTAARRGGEETTSS
  174.      Several standard ppmmaakkee targets are available in  any  direc-
  175.      tory managed by mmkkmmff:
  176.  
  177.      _d_e_f_a_u_l_t       If you type ppmmaakkee with no arguments, then  the
  178.                    default  target just recompiles the program or
  179.                    library in this directory.  Compiled files are
  180.                    placed in the .mmdd subdirectory for the current
  181.                    target machine (see below for more information
  182.                    on target machines).
  183.  
  184.      cclleeaann         Remove  any  files  that  can  be  regenerated
  185.                    automatically  by  ppmmaakkee.  This frees up space
  186.                    on disk and forces  a  complete  recompilation
  187.                    the next time ppmmaakkee is invoked.
  188.  
  189.      ttiiddyy          Remove  any  files  that  can  be  regenerated
  190.                    automatically  by ppmmaakkee, except the executable
  191.                    produced for a command.  This frees  up  space
  192.                    on  disk  and  forces a complete recompilation
  193.                    the next time ppmmaakkee is invoked, but it  leaves
  194.  
  195.  
  196.  
  197. Sprite v.1.0         Printed:  May 31, 1991                     3
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. MKMF                      User Commands                      MKMF
  205.  
  206.  
  207.  
  208.                    around the unstripped executable for debugging
  209.                    purposes.
  210.  
  211.      ddeebbuugg         Valid for libraries only.  Generate a  version
  212.                    of  the  library  with debugging symbols.  The
  213.                    default for libraries is  to  compile  without
  214.                    debugging information
  215.  
  216.      ddeeppeenndd        Regenerate the ddeeppeennddeenncciieess..mmkk file in the ..mmdd
  217.                    subdirectory  for  the current target machine.
  218.                    This target  should  be  re-made  when  source
  219.                    files  are  created or deleted, or when header
  220.                    file usage has changed.
  221.  
  222.      iinnssttaallll       Recompiles the information in  this  directory
  223.                    and  installs  it in its official system loca-
  224.                    tion, so that it can be used by other  people.
  225.                    For commands, this means copying the binary of
  226.                    the command to the appropriate system  command
  227.                    directory and saving the old installed version
  228.                    of the command in  a  backup  directory.   For
  229.                    libraries,  it  means copying the library's .aa
  230.                    file to the relevant  library  directory,  and
  231.                    also installing the library's header files and
  232.                    lint library.
  233.  
  234.      iinnssttaallllddeebbuugg  Valid for libraries only.  Install the version
  235.                    of the library with debugging symbols.
  236.  
  237.      iinnssttaallllhhddrrss   This target is only available in  library  and
  238.                    header  directories.   It  installs the public
  239.                    header files for the module in the appropriate
  240.                    system  header  directory.  MMkkmmff decides which
  241.                    header files are public and which are  private
  242.                    based  on  the  files'  names.  In order to be
  243.                    public, the first letters of a ..hh file must be
  244.                    the same as the name of the directory, and the
  245.                    string IInntt must not appear in the file's name.
  246.                    Thus,  in the library ssxx the file ssxx..hh is pub-
  247.                    lic, whereas the files ssxxIInntt..hh and  ffoooo..hh  are
  248.                    treated as private.
  249.  
  250.      iinnssttaalllllliinntt   This  target  is  only  available  in  library
  251.                    directories.  It generates a lint library file
  252.                    for the contents of this module  and  installs
  253.                    it in the system lint library.
  254.  
  255.      iinnssttaallllpprrooffiillee
  256.                    This  target  is  only  available  in  library
  257.                    directories.   It  installs the version of the
  258.                    library that has been compiled for profiling.
  259.  
  260.  
  261.  
  262.  
  263. Sprite v.1.0         Printed:  May 31, 1991                     4
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270. MKMF                      User Commands                      MKMF
  271.  
  272.  
  273.  
  274.      lliinntt          Run lint on this program/library and the other
  275.                    programs  and  libraries  it  uses.  Output is
  276.                    placed in the file lliinntt in the  ..mmdd  subdirec-
  277.                    tory for the current machine.
  278.  
  279.      mmkkmmff          Run mmkkmmff to regenerate the Makefile  for  this
  280.                    directory.    This target is particularly use-
  281.                    ful in top-level directories with  many  chil-
  282.                    dren,  since  it  will run mmkkmmff recursively in
  283.                    each of the subdirectories.
  284.  
  285.      nneewwttmm         Set things up to compile for  a  new  type  of
  286.                    target machine (which must be specified expli-
  287.                    citly using the TTMM variable).   This  includes
  288.                    creating  a  ..TTMM  subdirectory  and re-running
  289.                    mmkkmmff.
  290.  
  291.      pprrooffiillee       Compile a profiled version of the  command  or
  292.                    library.
  293.  
  294.      ttaaggss          Generate a ttaaggss file in  this  directory  that
  295.                    describes  all  the  information in all of the
  296.                    source files  for  this  program  or  library,
  297.                    including both the machine-independent sources
  298.                    and the machine-dependent sources for all tar-
  299.                    get machines.
  300.  
  301.  
  302. TTAARRGGEETT MMAACCHHIINNEESS
  303.      The  above  targets  all  apply  to  the  ``current   target
  304.      machine'',  which  is  the  value  of  the  TTMM  variable  in
  305.      MMaakkeeffiillee.  If you wish to compile  for  a  different  target
  306.      machine,  you  can specify an explicit value of the TTMM vari-
  307.      able on the ppmmaakkee command line, such as
  308.  
  309.           ppmmaakkee  TTMM==ssuunn22
  310.  
  311.      or
  312.  
  313.           ppmmaakkee  iinnssttaallll  TTMM==ssuunn33
  314.  
  315.      There are also  four  other  ways  you  can  specify  target
  316.      machines as part of ppmmaakkee targets:
  317.  
  318.      _t_m            If you specify a target  machine  as  a  ppmmaakkee
  319.                    target,  such  as ppmmaakkee ssuunn22, then the default
  320.                    target  will  be  made  for  that   particular
  321.                    machine
  322.  
  323.      aallll           The aallll target causes the default target to be
  324.                    made  for  all target machines currently known
  325.                    for this directory.
  326.  
  327.  
  328.  
  329. Sprite v.1.0         Printed:  May 31, 1991                     5
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. MKMF                      User Commands                      MKMF
  337.  
  338.  
  339.  
  340.      _t_a_r_g_e_t _t_m     If you add a machine name as a suffix  to  one
  341.                    of   the   standard   targets,   e.g.,   ppmmaakkee
  342.                    iinnssttaallllssuunn22 or ppmmaakkee lliinnttssuunn33, the  result  is
  343.                    equivalent to specifying the TTMM variable:  the
  344.                    target  is  re-made  for  the  given   machine
  345.                    instead of the default machine.
  346.  
  347.      _t_a_r_g_e_taallll     If you add the aallll suffix to  a  target,  e.g.
  348.                    ppmmaakkee  iinnssttaallllaallll, then _t_a_r_g_e_t will be re-made
  349.                    for all known target machines.
  350.  
  351.      The list of known target machines is given by  the  MMAACCHHIINNEESS
  352.      variable  specified  in MMaakkeeffiillee.  This variable is set from
  353.      the names of ..mmdd subdirectories at the time mmkkmmff is run.  To
  354.      add  a  new  target  machine, ffoooo for example, create a sub-
  355.      directory ffoooo..mmdd and then re-run mmkkmmff.
  356.  
  357.  
  358. AADDDDIITTIIOONNAALL PPMMAAKKEE VVAARRIIAABBLLEESS
  359.      There  are  a  few  variable  names   that   mmkkmmff   reserves
  360.      exclusively  for  your  use, as a way of controlling various
  361.      things.  The makefiles generated  by  mmkkmmff  will  use  these
  362.      variables, if you set them on a ppmmaakkee command line:
  363.  
  364.      NNOOBBAACCKKUUPP      Normally, when a command is installed the pre-
  365.                    vious  version  of  the  command is saved in a
  366.                    backup directory.  If  you  set  the  NNOOBBAACCKKUUPP
  367.                    variable  to  any  value,  then no backup copy
  368.                    will be saved.
  369.  
  370.      BBAACCKKUUPPAAGGEE     If NOBACKUP is not defined, then  normally,  a
  371.                    backup  overwrites  a  previous backup only if
  372.                    the file being backed up is  sufficiently  old
  373.                    to  be  deemed  stable  (run  uuppddaattee --hheellpp for
  374.                    information about the  default  age).   BACKU-
  375.                    PAGE,  if  set, overrides the default age used
  376.                    for this purpose.
  377.  
  378.      XXAAFFLLAAGGSS       Extra flags that will be used in all assembler
  379.                    invocations,  in addition to the standard ones
  380.                    set up by the makefiles.
  381.  
  382.      XXCCFFLLAAGGSS       Extra flags that will be used in all C  compi-
  383.                    lations,  in addition to the standard ones set
  384.                    up by the makefiles.
  385.  
  386.      In addition to the variables above, you  can  also  override
  387.      other  variables  defined  in  the makefiles.  See "LOCAL.MK
  388.      VARIABLES" below.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395. Sprite v.1.0         Printed:  May 31, 1991                     6
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402. MKMF                      User Commands                      MKMF
  403.  
  404.  
  405.  
  406. PPEERRSSOONNAALLIIZZAATTIIOONN
  407.      The makefiles generated by mmkkmmff won't always  do  the  right
  408.      thing  without additional program-specific information.  For
  409.      example, a particular program may  need  to  use  additional
  410.      libraries  besides  the C library, or it may need particular
  411.      compiler switches, or certain files may  need  special  pro-
  412.      cessing during compilation.  There are six ways to personal-
  413.      ize the information in a particular directory, each of which
  414.      is invoked by creating a file with a particular name:
  415.  
  416.      kkeerrnneell..mmkk     This file can be used to  create  personalized
  417.                    Sprite  kernels.   MMaakkeeffiillees  in kernel module
  418.                    directories will check for the existence of  a
  419.                    kkeerrnneell..mmkk  file in your home directory. If the
  420.                    file exists  it  will  be  included  prior  to
  421.                    including  any  other  files. The kkeerrnneell..mmkk is
  422.                    intended modify the behavior of a  sysmakefile
  423.                    for  a  kernel  module,  not to replace it. In
  424.                    this respect a  kkeerrnneell..mmkk  file  is  different
  425.                    from a llooccaall..mmkk file.
  426.  
  427.      llooccaall..mmkk      This is the simplest and most common  form  of
  428.                    personalization.    MMaakkeeffiillee  checks  for  the
  429.                    existence of llooccaall..mmkk;   if  it  exists,  then
  430.                    MMaakkeeffiillee    includes   it   instead   of   the
  431.                    sysmakefile.  Usually llooccaall..mmkk contains a  few
  432.                    ppmmaakkee   commands,   then   it   includes   the
  433.                    sysmakefile (whose name is passed in the vari-
  434.                    able  SYSMAKEFILE),  then it issues a few more
  435.                    ppmmaakkee  commands.   See   "LOCAL.MK   EXAMPLES"
  436.                    below.
  437.  
  438.      MMaakkeeffiillee..sseedd  If MMaakkeeffiillee..sseedd exists when  mmkkmmff  runs,  then
  439.                    mmkkmmff  uses  it  as  a  Sed  script  to  modify
  440.                    MMaakkeeffiillee.  If the --ff switch has been  used  to
  441.                    specify  a  different  makefile, say ffoooo, then
  442.                    mmkkmmff looks for ffoooo..sseedd.   In  particular,  you
  443.                    can  place  a  file  mmdd..mmkk..sseedd  in  a machine-
  444.                    dependent subdirectory in order to modify  the
  445.                    mmdd..mmkk  file.  Most things that you can do with
  446.                    a MMaakkeeffiillee..sseedd script you can  also  do  in  a
  447.                    llooccaall..mmkk  file; this feature is mostly a left-
  448.                    over from  ancient  times  when  the  llooccaall..mmkk
  449.                    facility didn't exist.
  450.  
  451.      MMaakkeeffiillee..eexx   Similar to MMaakkeeffiillee..sseedd, except mmkkmmff  uses  it
  452.                    as an Ex script to modify MMaakkeeffiillee.
  453.  
  454.      MMaakkeeffiillee..pprroottoo
  455.                    If this file exists when mmkkmmff runs, then  mmkkmmff
  456.                    uses it as a prototype makefile instead of one
  457.                    from the mmkkmmff library.  See ``HOW MKMF WORKS''
  458.  
  459.  
  460.  
  461. Sprite v.1.0         Printed:  May 31, 1991                     7
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468. MKMF                      User Commands                      MKMF
  469.  
  470.  
  471.  
  472.                    below for what this means.
  473.  
  474.      mmkkmmff..llooccaall    If this  file  exists,  it  must  be  a  shell
  475.                    script.   It will be executed by mmkkmmff in place
  476.                    of the standard type-specific mmkkmmff script that
  477.                    would   normally   be   executed  to  generate
  478.                    MMaakkeeffiillee.  See ``HOW MKMF  WORKS''  below  for
  479.                    more information on this.
  480.  
  481.      Finally, there is one other, even more radical, way for  you
  482.      to  control  what's  in your MMaakkeeffiillee, and that is to create
  483.      your own MMaakkeeffiillee from scratch and make sure it  contains  a
  484.      line  ``#  No mkmf''.  MMkkmmff will refuse to do anything if it
  485.      finds a MMaakkeeffiillee with such a comment in it; you can then put
  486.      anything you like in the MMaakkeeffiillee.  It's probably a bad idea
  487.      (and unnecessary) for you ever to  generate  a  Makefile  by
  488.      hand  in any Sprite system directory, but if you do, be sure
  489.      it has a ``# No mkmf'' line: it is common  practice  to  run
  490.      mmkkmmff  indiscriminately  on system directories, and this will
  491.      make sure your MMaakkeeffiillee doesn't accidentally get overwritten
  492.      (actually, mmkkmmff won't overwrite a makefile unless it finds a
  493.      line ``# Allow mkmf'' in it, but if it doesn't find a ``# No
  494.      mkmf''  line  then  it  will ask for permission to overwrite
  495.      it).
  496.  
  497.  
  498. HHOOWW MMKKMMFF WWOORRKKSS
  499.      The mmkkmmff program runs as  a  two-stage  shell  script.   The
  500.      top-level script is the mmkkmmff program itself.  It does things
  501.      that are common to all uses of mmkkmmff, such  as  checking  for
  502.      the ``# Allow mkmf'' line in your MMaakkeeffiillee and running ppmmaakkee
  503.      ddeeppeennddaallll.  There are several  second-level  shell  scripts,
  504.      called  _t_y_p_e-_s_p_e_c_i_f_i_c scripts.  Each one of these scripts is
  505.      set up to handle a particular kind  of  directory,  such  as
  506.      those  for  libraries,  programs,  or directories containing
  507.      only header files.  The type-specific scripts correspond  to
  508.      the sysmakefiles:  for each type, there is an mmkkmmff script to
  509.      generate its MMaakkeeffiillee, a prototype makefile that the  script
  510.      fills  in,  and a sysmakefile in //sspprriittee//lliibb//ppmmaakkee that does
  511.      most of the real work for making things of that  type.   The
  512.      type-specific scripts and prototype makefiles are all stored
  513.      in  //sspprriittee//lliibb//mmkkmmff  with  names  like   mmkkmmff..lliibbrraarryy   and
  514.      MMaakkeeffiillee..lliibbrraarryy.
  515.  
  516.      MMkkmmff uses the file //sspprriittee//lliibb//mmkkmmff//mmkkmmff..mmaapp to select which
  517.      type-specific script to use.  MMkkmmff..mmaapp is an awk script that
  518.      performs pattern matching on the current directory to select
  519.      a  type-specific  script.  This file has already been set up
  520.      to handle most of the system areas, but if you add  a  major
  521.      new  area  of  programs or libraries you'll probably have to
  522.      add a new  entry  in  mmkkmmff..mmaapp.   If  mmkkmmff  finds  a  script
  523.      mmkkmmff..llooccaall  in  the  current  directory,  then  mmkkmmff uses it
  524.  
  525.  
  526.  
  527. Sprite v.1.0         Printed:  May 31, 1991                     8
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534. MKMF                      User Commands                      MKMF
  535.  
  536.  
  537.  
  538.      instead  of  the  one  that  would  have  been  selected  by
  539.      mmkkmmff..mmaapp.   Similarly,  if there is a file MMaakkeeffiillee..pprroottoo in
  540.      the current directory, it is used  instead  of  the  default
  541.      prototype makefile.
  542.  
  543.      You can reconfigure the way that mmkkmmff  works  by  placing  a
  544.      file  ..mmkkmmff  in  your  home directory.  If this file exists,
  545.      mmkkmmff will source it as a shell script just after  doing  its
  546.      initialization.   You  can  use  this  feature  to  set up a
  547.      private map for yourself and change other internal  features
  548.      of  mmkkmmff.  For more details on how this works, read the top-
  549.      level mmkkmmff script.
  550.  
  551.  
  552. CCUURRRREENNTT TTYYPPEESS
  553.      Although the list of available type-dependent  scripts  will
  554.      probably  grow  and  change faster than this man page can be
  555.      updated, here are the types that were available  as  of  the
  556.      last  time the man page was updated.  To force mmkkmmff to use a
  557.      particular type (e.g., ``library'' instead of  ``command''),
  558.      use either a mmkkmmff..llooccaall or a MMaakkeeffiillee..pprroottoo, as described in
  559.      ``HOW MKMF WORKS,'' above.
  560.  
  561.      ccoommmmaanndd       This type is for command directories where all
  562.                    of  the  files  related  to  the  command  are
  563.                    together in a single  directory  and  its  ..mmdd
  564.                    subdirectories.   It  is the default type used
  565.                    by mmkkmmff for directories not explicitly  listed
  566.                    in  mmkkmmff..mmaapp.   MMaakkeeffiillee will compile and link
  567.                    the command into _t_m..mmdd//_n_a_m_e, where _t_m  is  the
  568.                    name  of a target machine and _n_a_m_e is the name
  569.                    of  the  directory  containing  MMaakkeeffiillee  (the
  570.                    directory name and command name are assumed to
  571.                    be the same).  MMaakkeeffiillee will install the  com-
  572.                    mand  into  the  appropriate  system directory
  573.                    (see the mmkkmmff scripts  for  details  on  where
  574.                    this  is).  During the conversion of Sprite to
  575.                    the new C library, this type of  directory  is
  576.                    actually  ccoommmmaanndd22, but it will revert to ccoomm--
  577.                    mmaanndd when the conversion is finished.
  578.  
  579.      bbiiggccmmdd        This type is for commands whose  source  files
  580.                    have  been partitioned into multiple subdirec-
  581.                    tories, with one MMaakkeeffiillee for  each  subdirec-
  582.                    tory.  The MMaakkeeffiillees in the subdirectories are
  583.                    of type bbiiggccmmdd, and the MMaakkeeffiillee of the parent
  584.                    is  of  type bbiiggccmmddttoopp.  Each bbiiggccmmdd subdirec-
  585.                    tory contains _t_m..mmdd subdirectories, which con-
  586.                    tain object files compiled from that subdirec-
  587.                    tory plus a file lliinnkkeedd..oo, which  consists  of
  588.                    all  the  object  files from that subdirectory
  589.                    linked together.
  590.  
  591.  
  592.  
  593. Sprite v.1.0         Printed:  May 31, 1991                     9
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600. MKMF                      User Commands                      MKMF
  601.  
  602.  
  603.  
  604.      bbiiggccmmddttoopp     This type is used for a command source  direc-
  605.                    tory  that contains one or more subdirectories
  606.                    of type bbiiggccmmdd.  The MMaakkeeffiillee in  this  direc-
  607.                    tory  will  cause all the children directories
  608.                    to be re-made, plus  it  will  regenerate  the
  609.                    file  _t_m..mmdd//_n_a_m_e,  where  _t_m  is the name of a
  610.                    target machine and _n_a_m_e is  the  name  of  the
  611.                    bbiiggccmmddttoopp  directory.   A special target qquuiicckk
  612.                    is also available  in  bbiiggccmmddttoopp  directories:
  613.                    it  will  relink _t_m..mmdd//_n_a_m_e using the existing
  614.                    lliinnkkeedd..oo  files  from  the  children,  without
  615.                    passing  through  all  the  subdirectories  to
  616.                    remake there.
  617.  
  618.      lliibbrraarryy       This type is for directories containing all of
  619.                    the  files  related  to  a particular library.
  620.                    MMaakkeeffiillee will compile all  the  files  in  the
  621.                    directory  and  assemble  them into an archive
  622.                    file named _t_m..mmdd//lliibb_n_a_m_e..aa,, wwhheerree  _t_m  is  the
  623.                    name  of a target machine and _n_a_m_e is the name
  624.                    of  the  directory  containing  MMaakkeeffiillee  (the
  625.                    directory name and library name are assumed to
  626.                    be  the  same).   MMaakkeeffiillee  will  install  the
  627.                    library and its headers and lint library.
  628.  
  629.      bbiigglliibb        This type is for libraries  with  many  source
  630.                    files,  such  as the C library.  The library's
  631.                    sources are assumed to be split over many sub-
  632.                    directories,  with  one MMaakkeeffiillee for each sub-
  633.                    directory.  The  MMaakkeeffiillees  in  the  subdirec-
  634.                    tories are of type bbiigglliibb, and the MMaakkeeffiillee of
  635.                    the parent is  of  type  bbiigglliibbttoopp.   Compiled
  636.                    files  will be archived together into the file
  637.                    ....//_t_m..mmdd//lliibb_n_a_m_e..aa (relative to the  subdirec-
  638.                    tories containing the bbiigglliibb MMaakkeeffiillees), where
  639.                    _t_m is the name of a target machine and _n_a_m_e is
  640.                    the  name  of  the  top-level  directory  (the
  641.                    directory containing the bbiigglliibb directories is
  642.                    assumed  to  have the same name as the overall
  643.                    library).
  644.  
  645.      bbiigglliiggttoopp     This is the type of a directory that  contains
  646.                    one   or   more  bbiigglliibb  subdirectories.   The
  647.                    MMaakkeeffiillee in this directory will pass  most  of
  648.                    the  standard  targets  along  to its children
  649.                    directories.  The installation  targets  (such
  650.                    as  iinnssttaallll and iinnssttaalllllliinntt) should be invoked
  651.                    in   this   directory.    A   special   target
  652.                    iinnssttaallllqquuiicckk  is  also  available in bbiigglliibbttoopp
  653.                    directories:  it  will  install  the  standard
  654.                    version of the library without cycling through
  655.                    all of the subdirectories to give each of them
  656.  
  657.  
  658.  
  659. Sprite v.1.0         Printed:  May 31, 1991                    10
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666. MKMF                      User Commands                      MKMF
  667.  
  668.  
  669.  
  670.                    a chance to recompile.
  671.  
  672.      kkeerrnneell        This type is used in the directories that hold
  673.                    the major modules of the Sprite kernel.
  674.  
  675.      hhddrrss          This type is used for  directories  that  hold
  676.                    nothing  but  ``.h''  files  for  the standard
  677.                    library.  The only thing you can do with ppmmaakkee
  678.                    is  to  install the header files;  the default
  679.                    target does this, as does ppmmaakkee  iinnssttaallll.   In
  680.                    addition,  ppmmaakkee rreeccuurrssiivvee will install header
  681.                    files in this directory and all  of  its  sub-
  682.                    directories  (this  is  only useful for header
  683.                    directories that contain  more  header  direc-
  684.                    tories as subdirectories).
  685.  
  686.      ttoopp           This is a general-purpose type for directories
  687.                    that  don't have anything interesting in them-
  688.                    selves, but have  child  directories  that  do
  689.                    contain interesting things.  When ppmmaakkee is run
  690.                    in such a directory, the MMaakkeeffiillee will  simply
  691.                    pass  all the standard targets down to each of
  692.                    its child directories in turn.  This  type  of
  693.                    MMaakkeeffiillee  is  used,  for  example, in the top-
  694.                    level directory of a  bbiigglliibb  tree,  or  in  a
  695.                    top-level  commands  directory,  each of whose
  696.                    children is of type ccoommmmaanndd.
  697.  
  698.  
  699. LLOOCCAALL..MMKK VVAARRIIAABBLLEESS
  700.      The following list describes some of the variables that  you
  701.      may  wish  to  use,  augment  (using ``+=''), or override in
  702.      llooccaall..mmkk files.  This is just a list of the  most  commonly-
  703.      used   variables.    For   other   possibilities,  read  the
  704.      makefiles.
  705.  
  706.      AAFFLLAAGGSS            Flags passed to the  assembler.   You  may
  707.                        wish to augment this in llooccaall..mmkk.
  708.  
  709.      CCFFLLAAGGSS            Flags passed to the C compiler.   You  may
  710.                        wish  to  augment  this  in  llooccaall..mmkk, for
  711.                        example   to   define   certain   compiler
  712.                        switches.   Or, you can override the value
  713.                        in MMaakkeeffiillee with something completely dif-
  714.                        ferent.
  715.  
  716.      CCLLEEAANNOOBBJJSS         A list of object files and other things to
  717.                        delete  as  part  of  ppmmaakkee cclleeaann or ppmmaakkee
  718.                        ttiiddyy.
  719.  
  720.      HHDDRRSS              A list of all the  locally-defined  ``.h''
  721.                        files    (both    machine-dependent    and
  722.  
  723.  
  724.  
  725. Sprite v.1.0         Printed:  May 31, 1991                    11
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732. MKMF                      User Commands                      MKMF
  733.  
  734.  
  735.  
  736.                        machine-independent) used to compile  this
  737.                        module.
  738.  
  739.      IINNSSTTAALLLLDDIIRR        The base directory in which a program gets
  740.                        installed.    MMkkmmff  will  add  a  machine-
  741.                        dependent suffix onto this,  depending  on
  742.                        the  particular machine being compiled for
  743.                        (see the makefiles  for  more  details  on
  744.                        this).
  745.  
  746.      IINNSSTTAALLLLFFLLAAGGSS      Flags passed to uuppddaattee when the module  is
  747.                        installed.   You  may  wish  to  add extra
  748.                        flags, like --mm  44775555  to  make  a  program
  749.                        set-user-id.
  750.  
  751.      OOBBJJSS              A list of all the  object  files  used  to
  752.                        link  together  this  module.  These files
  753.                        should always be  in  a  machine-dependent
  754.                        directory.
  755.  
  756.      SSRRCCSS              A list  of  all  the  source  files  (both
  757.                        machine-dependent and machine-independent)
  758.                        that comprise the module's version for the
  759.                        current target machine.
  760.  
  761.      SSUUBBDDIIRRSS           A list of all the subdirectories  of  this
  762.                        directory,  except  those  of type _t_m..mmdd).
  763.                        Is usually  only  available  in  top-level
  764.                        Makefiles,  like  those  in directories of
  765.                        type ttoopp, bbiiggccmmddttoopp, or  bbiigglliibbttoopp.   This
  766.                        variable determines where to invoke recur-
  767.                        sive sub-makes.
  768.  
  769.      TTMM                The name of the  current  target  machine.
  770.                        Normally  this is specified on the command
  771.                        line or  defaulted  in  MMaakkeeffiillee,  so  you
  772.                        shouldn't modify it.
  773.  
  774.  
  775. LLOOCCAALL..MMKK EEXXAAMMPPLLEESS
  776.      The normal structure for a llooccaall..mmkk file is for it to set up
  777.      or modify a few variables, include the sysmakefile, and then
  778.      add  new  targets  or  extend   targets   defined   by   the
  779.      sysmakefile.   For  example,  here is a simple llooccaall..mmkk that
  780.      defines some additional compiler  variables  (by  adding  to
  781.      CCFFLLAAGGSS) and uses an extra library:
  782.  
  783.           CCFFLLAAGGSS    ++== --DDNNAAMMEE==tteessttPPrroogg
  784.           LLIIBBSS      ++== --llmm  --XX1111
  785.           ##iinncclluuddee  <<$$((SSYYSSMMAAKKEEFFIILLEE))>>
  786.  
  787.      Or, below is a llooccaall..mmkk that generates an additional C  file
  788.  
  789.  
  790.  
  791. Sprite v.1.0         Printed:  May 31, 1991                    12
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798. MKMF                      User Commands                      MKMF
  799.  
  800.  
  801.  
  802.      from  a  template.  Since the file may not have existed when
  803.      mmkkmmff was run, it must be added to the SSRRCCSS  and  OOBBJJSS  vari-
  804.      ables  generated by mmkkmmff.  In addition, when this program is
  805.      installed (using the uuppddaattee command), it is marked  at  set-
  806.      user-id (mode 4755):
  807.  
  808.           SSRRCCSS           ++== aauuttoo..cc
  809.           OOBBJJSS           ++== $$((TTMM))..mmdd//aauuttoo..oo
  810.           IINNSSTTAALLLLFFLLAAGGSS   ++== --mm 44775555
  811.  
  812.           ##iinncclluuddee       <<$$((SSYYSSMMAAKKEEFFIILLEE))>>
  813.  
  814.           aauuttoo..cc:: tteemmppllaattee pprroogg
  815.                pprroogg tteemmppllaattee >> aauuttoo..cc
  816.  
  817.      The reason  for  adding  new  targets  after  including  the
  818.      sysmakefile  is to allow the sysmakefile to define the first
  819.      target, which is the default that will be made if  ppmmaakkee  is
  820.      invoked  with no arguments.  If, on the other hand, you want
  821.      to change the  default  target,  then  you  can  define  the
  822.      default target before including the sysmakefile.
  823.  
  824.      As a third  example,  consider  a  program  that  uses  non-
  825.      standard  header files.  It would have a local.mk that looks
  826.      something like
  827.  
  828.           ##iinncclluuddee  <<$$((SSYYSSMMAAKKEEFFIILLEE))>>
  829.  
  830.           ..PPAATTHH..hh :: //sspprriittee//lliibb//iinncclluuddee..ssppeecciiaall
  831.  
  832.      Notice that the ..PPAATTHH..hh line comes after the sysmakefile  is
  833.      included.
  834.  
  835.  
  836. SSEEEE AALLSSOO
  837.      pmake, sed, ex
  838.  
  839.  
  840. KKEEYYWWOORRDDSS
  841.      make, Makefile, prototype
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857. Sprite v.1.0         Printed:  May 31, 1991                    13
  858.  
  859.  
  860.  
  861.